﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WaterRevenueMS.Domain.Common.Models;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;

namespace WaterRevenueMS.Domain.ViewModels.Maintenance.MeterInfoSet
{
    public class MeterInfoSetModel:EntityCommon
    {
        public MeterInfoSetModel()
        {
            Search = new SearchModel();
            WayOfChargeItems = new List<SelectListItem> { 
                new SelectListItem{Text="请选择收费方式",Value="0"}
            };
            CustomerItems = new List<SelectListItem>();
            KindOfWaterUseItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择用水性质",Value="0"}
            };
            MeterTypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择表类型",Value="0"}
            };
            RelayTypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择中继类型",Value="0"}
            };
            ConcentratorTypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择集中器类型",Value="0"}
            };
            HandSetItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择手抄器类型",Value="0"}
            };
            WaterCaliberItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择水表口径类型",Value="0"}
            };
            ManufacturerItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择水表厂商",Value="0"}
            };
            Yong_HSZ_No = 0;
        }

        public int Id { get; set; }

        [Display(Name="用户代码")]
        public int? Yong_HSZ_No { get; set; }
        public List<SelectListItem> CustomerItems { get; set; }
        public string CustomerName { get; set; }

        public int? Shou_FFS_No { get; set; }
        public List<SelectListItem> WayOfChargeItems { get; set; }
        public string WayOfChargeName { get; set; }

        public int? Yong_SLX_No { get; set; }
        public List<SelectListItem> KindOfWaterUseItems { get; set; }
        public string KindOfWaterUseName { get; set; }

        public int? Yi_BLX_No { get; set; }
        public List<SelectListItem> MeterTypeItems { get; set; }
        public string MeterTypeName { get; set; }

        public int? Zhong_JLX_No { get; set; }
        public List<SelectListItem> RelayTypeItems { get; set; }
        public string RelayTypeName { get; set; }

        [Display(Name="中继地址")]
        public string Zhong_JDZ { get; set; }
        public byte Zhong_JTD { get; set; }

        public int? Ji_ZQLX_No { get; set; }
        public List<SelectListItem> ConcentratorTypeItems { get; set; }
        public string ConcentratorTypeName { get; set; }

        public string Ji_ZQDZ { get; set; }
        public byte Ji_ZQTD { get; set; }

        public int? Shou_CQLX_No { get; set; }
        public List<SelectListItem> HandSetItems { get; set; }
        public string HandSetName { get; set; }

        public int? Shui_BKJ_No { get; set; }
        public List<SelectListItem> WaterCaliberItems { get; set; }
        public string WaterCaliberName { get; set; }

        public int? Shui_BCS_No { get; set; }
        public List<SelectListItem> ManufacturerItems { get; set; }
        public string ManufacturerName { get; set; }

        [Display(Name="表名称")]
        [Required(ErrorMessage="水表名称不能为空")]
        [StringLength(16, MinimumLength = 2, ErrorMessage = "仪表名称不能大于{1}个字符")]
        public string Yi_BMC { get; set; }

        [Display(Name = "表编号")]
        [StringLength(16, MinimumLength = 0, ErrorMessage = "表编号不能大于{1}个字符")]
        public string Yi_BBH { get; set; }

        [Display(Name = "表地址")]
        [StringLength(24, MinimumLength = 0, ErrorMessage = "表地址不能大于{1}个字符")]
        public string Yi_BDZ { get; set; }

        [Display(Name="表通道")]
        public byte Yi_BDD { get; set; }

        [Display(Name="倍率")]
        public float Bei_L { get; set; }

        [Display(Name="铅封号")]
        [StringLength(16, MinimumLength = 0, ErrorMessage = "铅封号不能大于{1}个字符")]
        public string Qian_FH { get; set; }

        [Display(Name="安装位置")]
        [StringLength(256, MinimumLength = 0, ErrorMessage = "安装位置不能大于{1}个字符")]
        public string An_ZWZ { get; set; }

        [Display(Name="启用日期")]
        [DataType(DataType.DateTime)]
        public DateTime? Qi_YDT { get; set; }

        [Display(Name="表累计值")]
        public float Biao_LJZ { get; set; }

        [Display(Name = "满程次数")]
        public int Man_CCS { get; set; }
        [Display(Name="翻表次数")]
        public int Fan_BCS { get; set; }

        [Display(Name = "本次抄表日期")]
        public DateTime? Chao_BDTBC { get; set; }
        [Display(Name="本期读数")]
        public float Du_SBQ { get; set; }
        [Display(Name = "上次抄表日期")]
        public DateTime? Chao_BDTSC { get; set; }
        [Display(Name = "上期读数")]
        public float Du_SSQ { get; set; }
        [Display(Name = "本次读数")]
        public float Du_SBC { get; set; }
        [Display(Name = "是否结算")]
        public byte Shi_FJS { get; set; }
        [Display(Name = "结算日期")]
        public DateTime? Jie_SDT { get; set; }
        [Display(Name = "本次用量")]
        public float Yong_LBC { get; set; }
        [Display(Name = "用量调整")]
        public float Yong_LTZ { get; set; }
        [Display(Name = "本期用量")]
        public float Yong_LBQ { get; set; }
        [Display(Name = "本次计费")]
        public float Ji_FBC { get; set; }
        [Display(Name = "费用调整")]
        public float Fei_YTZ { get; set; }
        [Display(Name = "本期计费")]
        public float Ji_FBQ { get; set; }

        public int OrderNo { get; set; }

        public SearchModel Search { get; set; }

    }
    public class SearchModel
    {
        public SearchModel()
        {
            KindOfWaterUseItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择用水性质",Value="0"}
            };
            RelayTypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择中继类型",Value="0"}
            };
            ConcentratorTypeItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择集中器类型",Value="0"}
            };
            HandSetItems = new List<SelectListItem>
            {
                new SelectListItem{Text="请选择手抄器类型",Value="0"}
            };

        }

        [Display(Name = "表名称")]
        public string Yi_BMC { get; set; }

        [Display(Name = "表编号")]
        public string Yi_BBH { get; set; }


        public int? Yong_SLX_No { get; set; }
        public List<SelectListItem> KindOfWaterUseItems { get; set; }

        public int? Zhong_JLX_No { get; set; }
        public List<SelectListItem> RelayTypeItems { get; set; }
        public string RelayTypeName { get; set; }

        [Display(Name = "中继地址")]
        public string Zhong_JDZ { get; set; }

        public int? Ji_ZQLX_No { get; set; }
        public List<SelectListItem> ConcentratorTypeItems { get; set; }

        public string Ji_ZQDZ { get; set; }

        public int? Shou_CQLX_No { get; set; }
        public List<SelectListItem> HandSetItems { get; set; }
    }
}
